'use strict'

if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices){

	console.log('enumerate Devices is note supported!');
}else{
	navigator.mediaDevices.enumerateDevices()
		.then(gotDevices)
		.catch(handleError);
}

function gotDevices(deviceInfos){
	deviceInfos.forEach(function(deviceInfo){
		console.log(
			" kind = " + deviceInfo.kind +
			" deviceid = " + deviceInfo.deviceid +
			" lable = " + deviceInfo.label +
			" groupid = " + deviceInfo.groupid 
		);
	})

}


function handleError(deviceInfos){}


